package com.itheima.webaitliasserver.mapper;

import com.itheima.webaitliasserver.pojo.Emp;
import com.itheima.webaitliasserver.pojo.EmpEntryParam;
import com.itheima.webaitliasserver.pojo.EmpJobOption;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * @ClassName: xiaoZhang
 * @Description:
 * @Author: Zhang
 * @CreateDate: 2025-07-22 19:31
 */
@Mapper
public interface EmpMapper {
    // 查询员工总数
    @Select("select count(*) from tailsemp e left join dept d on e.dept_id = d.id")
    public Long queryEmpCount();

    /**
    * @Author: Zhang
    * @param:        
    * @createTime: 2025/7/23 14:58
    * @Description: TODO
    * @Return: 无
    */
    @Select("select te.* , d.name deptName from tailsemp te left join dept d on te.dept_id = d.id limit #{start},#{pageSize} ")
    public List<Emp> queryEmpEveryPageRecord (@Param("start") Integer start , @Param("pageSize") Integer pageSize);

    // 使用分页插件查询员工数据
    @Select("select te.* , d.name deptName from tailsemp te left join dept d on te.dept_id = d.id" )
    public List<Emp> queryPageHelperEmpRecord ();
    // 根据选项参数查询员工
    public List<Emp> queryEmpByOptionMapper(EmpEntryParam entryParam);

    // 保存员工基本信息
    public void insertEmpRecordMapper(Emp emp);

    public void batchRemoveEmpRecordMapper(@Param("ids") Integer[] ids);

    public void removeEmpExprsMapper(@Param("empIds") Integer[] empIds);


    // 查询单个员工信息以及员工经历记录数据
    public Emp queryEmpRecordById(@Param("id") Integer id);


    void updateEmpInfoById(Emp emp);

    public void batchRemoveEmpExprsRecordMapper(@Param("ids") Integer[] ids);

}
